package com.darkteam.jhades.cs.message;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;

import com.darkteam.jhades.common.message.JHadesSerializable;

public class ServerNode implements JHadesSerializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3883692225748827652L;

	private short code;
	private byte load;
	private byte unknown;

	public ServerNode() {
	}

	public ServerNode(short code, byte load) {
		super();
		this.code = code;
		this.load = load;
	}

	public short getCode() {
		return code;
	}

	public void setCode(short code) {
		this.code = code;
	}

	public byte getLoad() {
		return load;
	}

	public void setLoad(byte load) {
		this.load = load;
	}

	public byte getUnknown() {
		return unknown;
	}

	public void setUnknown(byte unknown) {
		this.unknown = unknown;
	}

	@Override
	public ChannelBuffer toChannelBuffer() {
		ChannelBuffer buffer = ChannelBuffers.buffer(4);
		buffer.writeShort(code);
		buffer.writeByte(load);
		buffer.writeByte(unknown);
		return buffer;
	}

}
